package proto

type AgentInfo struct {
	AgentId          string `json:"agent_id"`
	AgentVer         int    `json:"agent_ver"`
	AgentTime        int64  `json:"agent_time"`
	AgentRateLimit   int64  `json:"agent_rate_limit"`
	AgentV6Reachable int    `json:"agent_v6_reachable"`
}

type BandwidthInfo struct {
	Bandwidth    int64 `json:"bandwidth"`
	RealTcpRate  int64 `json:"real_tcp_rate"`
	RealUdpRate  int64 `json:"real_udp_rate"`
	RealHttpRate int64 `json:"real_http_rate"`
}

type RunTimeInfo struct {
	SrvLastTime int64  `json:"srv_last_time"`
	EndTime     int64  `json:"end_time"`
	DebugInfo   string `json:"di"`
}

type InfoReq struct {
	AgentInfo
}

type LoginReq struct {
	AgentInfo
	BandwidthInfo
}

type AliveReq struct {
	AgentInfo
	BandwidthInfo
	RunTimeInfo
}

type InfoResp struct {
	Timestamp     int64  `json:"ts"`
	LoginUrl      string `json:"lu"`
	AliveUrl      string `json:"au"`
	SpeedUrl      string `json:"su"`
	SpeedDuration int    `json:"sd"`
}

type LoginResp struct {
	Timestamp     int64    `json:"ts"`
	AgentInterval int64    `json:"ai"`
	BlockCount    int64    `json:"bc"`
	TcpRateLimit  int64    `json:"trl"`
	UdpRateLimit  int64    `json:"url"`
	HttpRateLimit int64    `json:"hrl"`
	RateDelta     int64    `json:"rd"`
	PerUseCount   int      `json:"puc"`
	TcpAddresses  []string `json:"tas"`
	UdpAddresses  []string `json:"uas"`
	HttpUrls      []string `json:"hus"`
}

type AliveResp struct {
	Timestamp      int64 `json:"ts"`
	NeedUpdateRate int   `json:"nur"`
	TcpRateLimit   int64 `json:"trl"`
	UdpRateLimit   int64 `json:"url"`
	HttpRateLimit  int64 `json:"hrl"`
	PerUseCount    int   `json:"puc"`
}
